package com.lupengning.es.test.index;

import java.io.IOException;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;

public class ESTest_Index_Search {

  public static void main(String[] args) throws IOException {
    RestHighLevelClient esClient = new RestHighLevelClient(
        RestClient.builder(new HttpHost("192.168.56.10", 9200, "http"))
    );

    GetIndexRequest request = new GetIndexRequest("employee");

    GetIndexResponse response = esClient.indices().get(request, RequestOptions.DEFAULT);

    System.out.println(response.getAliases());
    System.out.println(response.getMappings());
    System.out.println(response.getSettings());

    esClient.close();
  }
}
